package com.lanou.managerLogin.category.web.servlet;

import com.lanou.managerLogin.category.domain.Category;
import com.lanou.managerLogin.category.service.CategoryService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/seeCategoryServlet")
public class SeeCategoryServlet extends HttpServlet {

    private CategoryService cs = new CategoryService();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<Category> cgs = cs.selCname();
        req.setAttribute("category",cgs);
        req.getRequestDispatcher("/adminjsps/admin/category/list.jsp").forward(req,resp);
    }
}
